fix(ui): display user message immediately on send#208
Conversation
Display user chat bubbles immediately when the send button is clicked instead of waiting for the server echo. The existing deduplication infrastructure (findLiveReplayCandidateIndex) upgrades the optimistic message with the server-assigned key when the echo arrives, preventing duplicates.
📋 GitRank PR AnalysisScore: 0 points (ineligible)
Eligibility Checks
Impact SummaryThis PR fixes a critical UX bug where user messages only appeared after page refresh because the UI waited for server echo via WebSocket. The fix implements optimistic message rendering that shows user bubbles immediately when sent, clears the composer input instantly, and deduplicates server echoes using existing infrastructure. The change improves perceived responsiveness and prevents message duplication while maintaining data consistency. Analysis DetailsComponent Classification: This PR affects UI chat functionality across multiple files (transcript handling, chat connection hook, and chat page component). Since no single component category clearly dominates and this is a cross-cutting UI fix, OTHER is the appropriate classification. Severity Justification: This is a P2 (Medium) severity bug. The issue causes a functional defect—user messages don't appear until page refresh—which significantly impacts user experience, but there is a workaround (refreshing the page). The fix is important for usability but doesn't cause data loss or service outage. Eligibility Notes: Issue: True—PR clearly describes fixing a bug (missing user message bubble). Fix Implementation: True—code changes directly implement optimistic rendering and deduplication as described. PR Linked: True—comprehensive description with test plan and detailed explanation. Tests: False—no test files were modified in the PR. Tests Required: True—this is a bug fix in business logic (chat message handling) that modifies core transcript and UI state management, which requires test coverage to prevent regression. The PR mentions '195/195 tests' passing but does not appear to add new tests for the optimistic message scenario. Analyzed by GitRank 🤖 |
Summary
findLiveReplayCandidateIndexinfrastructure to prevent duplicatesTest plan
npm testpasses (195/195 tests)